package org.ysling.litemall.core.tenant.enums;

/**
 * 多租户请求白名单枚举类
 */
public enum IgnoreRequestNames {

    request1("/wx/order/pay-notify", "支付回调接口"),
    request2("/admin/auth/login", "管理员登陆接口"),
    request3("/admin/auth/info", "管理员权限获取接口"),
    request4("/admin/auth/captcha", "管理员登陆验证码接口"),
    request5("/wx/auth/captcha/mobile", "微信手机验证码接口"),
    request6("/wx/auth/captcha/mail", "微信邮箱验证码接口"),
    request8("/admin/profile/nnotice", "管理员信息通知"),
    request9("/wx/auth/login", "微信登陆接口");

    public final String request;
    public final String message;

    IgnoreRequestNames(String request, String message) {
        this.request = request;
        this.message = message;
    }

    /**
     * 对比请求
     * @param request 请求地址
     * @return 存在true 不存在false
     */
    public static Boolean parseValue(String request) {
        if (request != null) {
            for (IgnoreRequestNames item : values()) {
                if (item.request.equals(request)) {
                    return true;
                }
            }
        }
        return false;
    }
}
